#include <iostream>
#define N 100

using namespace std;

void readintVector(int array[], int elements){
for (int i=0; i<elements; i++){
	cout<<"grade["<<i<<"]=";
	cin>>array[i];
	cout<<"\n";}
}

void grades(int array[], int elements){
int i;
int gr1=0;
int gr2=0;
int gr3=0;
int gr4=0;
int gr5=0;
int gr6=0;
int gr7=0;
int gr8=0;
int gr9=0;
int gr10=0;

for(i=0;i<elements;i++){
    if(array[i]==1){
        gr1+=1;}
    if(array[i]==2){
        gr2+=1;}
    if(array[i]==3){
        gr3+=1;}
    if(array[i]==4){
        gr4+=1;}
    if(array[i]==5){
        gr5+=1;}
    if(array[i]==6){
        gr6+=1;}
    if(array[i]==7){
        gr7+=1;}
    if(array[i]==8){
        gr8+=1;}
    if(array[i]==9){
        gr9+=1;}
    if(array[i]==10){
        gr10+=1;}
}
cout<<"Grade 1:";
for(i=0; i<gr1; i++){
cout<<"*";
}
cout<<endl;
cout<<"Grade 2:";
for(i=0; i<gr2; i++){
cout<<"*";
}
cout<<endl;
cout<<"Grade 3:";
for(i=0; i<gr3; i++){
cout<<"*";
}
cout<<endl;
cout<<"Grade 4:";
for(i=0; i<gr4; i++){
cout<<"*";
}
cout<<endl;
cout<<"Grade 5:";
for(i=0; i<gr5; i++){
cout<<"*";
}
cout<<endl;
cout<<"Grade 5:";
for(i=0; i<gr5; i++){
cout<<"*";
}
cout<<endl;
cout<<"Grade 6:";
for(i=0; i<gr6; i++){
cout<<"*";
}
cout<<endl;
cout<<"Grade 7:";
for(i=0; i<gr7; i++){
cout<<"*";
}
cout<<endl;
cout<<"Grade 8:";
for(i=0; i<gr8; i++){
cout<<"*";
}
cout<<endl;
cout<<"Grade 9:";
for(i=0; i<gr9; i++){
cout<<"*";
}
cout<<endl;
cout<<"Grade10:";
for(i=0; i<gr10; i++){
cout<<"*";
}
}

int main(){
int array[N];
int elements;
cout<<"Type the number of elements you want in the array: ";
cin>>elements;
readintVector(array, elements);

cout<<"The grades histogram"<<endl;
grades(array, elements);

return 0;
}

